package io.renren.modules.oa.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.oa.dao.EscInstancesDao;
import io.renren.modules.oa.entity.EscInstancesEntity;
import io.renren.modules.oa.service.EscInstancesService;


@Service("escInstancesService")
public class EscInstancesServiceImpl extends ServiceImpl<EscInstancesDao, EscInstancesEntity> implements EscInstancesService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<EscInstancesEntity> page = this.selectPage(
                new Query<EscInstancesEntity>(params).getPage(),
                new EntityWrapper<EscInstancesEntity>()
                .orderBy("id", false)
        );

        return new PageUtils(page);
    }

	@Override
	public List<Map> queryEscInstanceList(Integer pageNo, Integer pageSize) {
		return baseMapper.queryEscInstanceList((pageNo - 1) * pageSize, pageSize);
	}

}
